﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.DataAnnotations;

namespace VehicleMaintenance.Models
{
    public class Goods
    {
        //ID, GoodTypeID, Code, Name, Cartype, Units, Placeoforigin, RetailPrice, WholesalePrice, PurchasePrice, Producer, Top, Bottom, Remark
        [Key]
        [Column("ID")]
        public int GoodID { get; set; }

        [Display(Name = "商品类别")]
        [Required(ErrorMessage = "请选择商品类别")]
        public int GoodTypeID { get; set; }

        [Display(Name = "商品编号")]
        [Required(ErrorMessage = "请输入商品编号")]
        public string Code { get; set; }

        [Display(Name = "商品名称")]
        [Required(ErrorMessage = "请输入商品名称")]
        public string Name { get; set; }

        [Display(Name = "车型")]
        [Required(ErrorMessage = "请选择车型")]
        public int CarTypeID { get; set; }

        [Display(Name = "计量单位")]
        public string Units { get; set; }

        [Display(Name = "产地")]
        public string Placeoforigin { get; set; }

        [Display(Name = "零售价")]
        [Required(ErrorMessage = "零售价不能为空")]
        public decimal RetailPrice { get; set; }

        [Display(Name = "批发价")]
        public decimal WholesalePrice { get; set; }

        [Display(Name = "进货价")]
        public decimal PurchasePrice { get; set; }

        [Display(Name = "供应商")]
        public string Producer { get; set; }

        [Display(Name = "当前库存")]
		[Required(ErrorMessage = "当前库存不能为空")]
        public int Number { get; set; }

        [Display(Name = "库存上限")]
        public int Top { get; set; }        

        [Display(Name = "库存底限")]
        public int Bottom { get; set; }

        [Display(Name = "备注")]
        public string Remark { get; set; }

        public GoodType GoodType { get; set; }

        public CarType CarType { get; set; }

    }
}
